﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace ModernShopping.AppCode.WebUtil
{
    [DataContract]
    public class Comment
    {
        [DataMember]
        public string UserComment { get; set; }

        [DataMember]
        public string UserName { get; set; }

        [DataMember]
        public string Time { get; set; }

        public static List<Comment> parseList(List<ProductComnent> listComments)
        {
            List<Comment> list = new List<Comment>();
            foreach (ProductComnent pc in listComments)
            {
                Comment tmp = new Comment();
                tmp.UserComment = pc.Comment;
                tmp.Time = pc.Time.ToString("HH:mm:ss dd/MM/yyyy");
                tmp.UserName = pc.UserName;
                list.Add(tmp);
            }
            return list;
        }
    }

    
}